CC = g++

ifeq ($(coverage),yes)
    CC += -fprofile-arcs -ftest-coverage
endif

GTEST_INC = -I/home/a/include
GTEST_LIB = -L/home/a/lib -lgtest
GTEST_MAIN= -lgtest_main

all : sample_unittest sample1_unittest


sample.o : sample.cpp sample.h
	$(CC) $(GTEST_INC) -c sample.cpp

sample_unittest.o : sample_unittest.cpp sample.h
	$(CC) $(GTEST_INC) -c sample_unittest.cpp

sample_unittest : sample.o sample_unittest.o
	$(CC) $(GTEST_INC) $(GTEST_LIB) -lpthread $^ -o $@ 

sample1.o : sample1.cc sample1.h 
	$(CC) $(GTEST_INC) -c sample1.cc

sample1_unittest.o : sample1_unittest.cc sample1.h
	$(CC) $(GTEST_INC) -c sample1_unittest.cc

sample1_unittest : sample1.o sample1_unittest.o 
	$(CC) $(GTEST_INC) $(GTEST_LIB) $(GTEST_MAIN) -lpthread $^ -o $@ 

clean:
	rm -f *.o sample1_unittest sample_unittest


